/*****************************************************************
Wowengine - v0.1

File: wen_light.cpp
Creation date: 2009-09-07
*****************************************************************/

/****************************************************************/
#include "wen_light.h"
#include "graphics/wen_render.h"
//----------------------------------------------------------------
using namespace wen;
/****************************************************************/

unsigned int Light::s_uiCurrentID = 0;
/****************************/
// Constructor
/****************************/
Light::Light()
:
Entity(),
m_uiID(s_uiCurrentID++),
m_bEnabled(true),
m_iType(LIGHT_POINT),
m_afDiffuse(std::vector<float>(3)),
m_afAmbient(std::vector<float>(3)),
m_afSpecular(std::vector<float>(3)),
m_afDirection(std::vector<float>(3)),
m_fAttenuation0(0.0f),
m_fAttenuation1(0.0f),
m_fAttenuation2(0.0f),
m_fRange(0.0f),
m_fFalloff(0.0f),
m_fTheta(0.0f),
m_fPhi(0.0f)
{
	m_afDiffuse[0] = 255.0f;
	m_afDiffuse[1] = 255.0f;
	m_afDiffuse[2] = 255.0f;

	m_afAmbient[0] = 0.0f;
	m_afAmbient[1] = 0.0f;
	m_afAmbient[2] = 0.0f;

	m_afSpecular[0] = 255.0f;
	m_afSpecular[1] = 255.0f;
	m_afSpecular[2] = 255.0f;

	m_afDirection[0] = 0.0f;
	m_afDirection[1] = 0.0f;
	m_afDirection[2] = 1.0f;
}
/****************************/
// Destructor
/****************************/
Light::~Light()
{
}
/****************************/
// Actualiza
/****************************/
void Light::Update(float fTimeBetweenFrames)
{
	Entity::Update(fTimeBetweenFrames);
}
/****************************/
// Dibuja
/****************************/
void Light::Draw(Render& rkRender) const
{
	Entity::Draw(rkRender);

	rkRender.BindLight(*this);
}
//----------------------------------------------------------------